package token

import (
	"math"
	"time"

	"go.wen.fyi/env"
)

var defaultService = &Service{key: uint64(math.Abs(env.GetFloat("TOKEN_KEY", 20200521)))}

func Create(tType byte, uid uint64, exp time.Time) (tokenString string) {
	return defaultService.Create(tType, uid, exp)
}

func Parse(tokenString string) (*Token, error) {
	return defaultService.Parse(tokenString)
}
